﻿<%@ Page Title="" Language="C#" MasterPageFile="~/admin/admin.master" AutoEventWireup="true" CodeFile="Group.aspx.cs" Inherits="admin_Menu_Group" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $(".addNew").colorbox({ width: "500px", inline: true, href: "#frmAddNew" });

        });

        function closeOverlay() {
            $.colorbox.close();

        }
        //ShowStatus('warning', 'Thêm mới chuyên mục thất bại.');
    </script>
    <div class="content-box-outer">
        <div class="content-box-right">
            <ul>
                <li><a href="Add_Edit.aspx" class="new tooltip" title="Thêm nhanh">Thêm menu</a></li>
                <li ><a href="Default.aspx">Menu</a></li>
                <li class="content-box-selected"><a href="Group.aspx">Nhóm</a></li>
            </ul>
        </div>
        <div class="content-box-left">
            <h1>Nhóm menu<a href="#" class="addNew" title="Thêm mới">Thêm nhóm</a></h1>
            <div style="display: none;">
                <div id="frmAddNew" class="overlaypanel">
                    <h2>Thêm nhóm</h2>
                    <ul class="fl">
                        <li>
                            <label>
                                Tên nhóm</label><br />
                            <asp:TextBox runat="Server" ID="txtNewPageTitle" Width="390" />
                            <asp:CustomValidator runat="Server" ID="valExist" ValidationGroup="new" ControlToValidate="txtNewPageTitle"
                                ErrorMessage="Chuyên mục đã tồn tại" Display="dynamic" />
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="Server" ValidationGroup="new"
                                ControlToValidate="txtNewPageTitle" ErrorMessage="*" Display="Dynamic" />
                        </li>
                    </ul>
                    <asp:Button runat="server" ID="btnAdd" ValidationGroup="new" CssClass="btn primary"
                        OnClientClick="colorboxDialogSubmitClicked('new', 'frmAddNew');"
                        Text="Thêm" OnClick="btnAdd_Click" />
                    hoặc
                    <a href="#" onclick="closeOverlay();" title="Hủy">Hủy</a>
                </div>
            </div>

            <div id="Container">

                <asp:GridView runat="server" ID="grid" CssClass="beTable" BorderStyle="Solid" RowStyle-BorderWidth="0"
                    RowStyle-BorderStyle="None" GridLines="None" Width="100%" AlternatingRowStyle-BackColor="#f8f8f8"
                    AlternatingRowStyle-BorderColor="#f8f8f8" HeaderStyle-BackColor="#F1F1F1" CellPadding="3"
                    AutoGenerateColumns="False" AutoGenerateEditButton="true" AutoGenerateDeleteButton="true"
                    DataKeyNames="GroupId">
                    <AlternatingRowStyle BackColor="#F8F8F8" BorderColor="#F8F8F8"></AlternatingRowStyle>
                    <Columns>
                        <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="ID">
                            <ItemTemplate>
                                <%# Eval("GroupId") %>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" />
                        </asp:TemplateField>

                        <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Chuyên mục">

                            <ItemTemplate>
                                <%# Eval("Name") %>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox runat="server" ID="txtTitle" Text='<%# Eval("Name") %>' />
                            </EditItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" />
                        </asp:TemplateField>



                        <asp:TemplateField HeaderStyle-HorizontalAlign="Left" HeaderText="Menu">
                            <ItemTemplate>
                                <%#CountMenu(Eval("GroupId")) %>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
                        </asp:TemplateField>

                    </Columns>
                    <HeaderStyle BackColor="#F1F1F1"></HeaderStyle>
                    <RowStyle BorderWidth="0px" BorderStyle="None"></RowStyle>
                </asp:GridView>
            </div>


        </div>
    </div>

    <script type="text/javascript">
        $(document).ready(function () {

            $(".tableToolBox a").click(function () {
                $(".tableToolBox a").removeClass("current");
                $(this).addClass("current");
            });
        });
    </script>


</asp:Content>

